import {binder, handler, view, ViewGroup} from "adajs";
import LodgeService from "./state.js";
import Bar from "../../../../controls/bar";
import List from "./../../../../controls/lists";

@view({
    className: "zbgz",
    template: "./template.html",
    style: "./style.scss",
    dataset: {
        service: LodgeService
    }
})
class Lodge extends ViewGroup {
    tags() {
        return {
            list: List,
            bar: Bar
        }
    }

    @handler("addmedical")
    addmedical() {
        this.dispatchEvent("gotoPage", "/admin/medical/hospital/add");
    }

    @binder('search')
    search() {
        let val = this.finder('input').getElement().value;
        this.commit('search', val);
    }
}

export default Lodge;